Thinking in Ramda: Immutability and Arrays
Reading Array Elements
Ramda functions for reading array elements nth
and slice
and contains
1 | const numbers = [10,20,30,40,50,60] |
nth(0)
equals head
, nth(-1)
equals last
.
It also provides functions for accesing all-but-the-first element tail
,all-but-the-last element init
,the first N elements take(N)
, and the last N elments takeLast(N)
.
Adding, Updating, and Removing Array Elements
insert
update
append
prepend
update
concat
concatAfter = flip(concat)
Transforming Elements
update
adjust
evolve